<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>添加新商品</title>
<meta name=robots content="noindex, nofollow">
<meta content="text/html; charset=utf-8" http-equiv=content-type>
<link rel=stylesheet type="text/css"  href="file/css/general.css">
<link rel=stylesheet type="text/css"  href="file/css/main.css">
<script type="text/javascript"  src="file/js/jquery-1.7.2.js"></script>
<meta name=generator content="mshtml 9.00.8112.16443">
</head>
<body>
<h1><span class=action-span><a  href="#">商品列表</a></span> <span class=action-span1> <a href="#">ecshop 管理中心</a> </span><span id=search_id class=action-span1>添加新商品 </span>
  <div style="clear: both"></div>
</h1>
<link rel=stylesheet type=text/css  href="file/css/calendar.css">
<!-- start goods form -->
<div class=tab-div>
  <!-- tab bar -->
  <div id=tabbar-div>
    <p><span id=general-tab class=tab-front>通用信息</span><span id=detail-tab 
    class=tab-back>详细描述</span><span id=mix-tab class=tab-back>其他信息</span><span 
    id=properties-tab class=tab-back>商品属性</span><span id=gallery-tab 
    class=tab-back>商品相册</span><span id=linkgoods-tab class=tab-back>关联商品</span><span 
    id=groupgoods-tab class=tab-back>配件</span><span id=article-tab 
    class=tab-back>关联文章</span> </p>
  </div>
  <!-- tab body -->
  <div id=tabbody-div>
    <form enctype="multipart/form-data" method="post" name="theform" action="admin.php?con=Products&act=addproduct">
      <table id=general-table width="90%" align=center>
        <tbody>
          <tr>
            <td class=label>商品名称：</td>
            <td><input type="text" style="float: left;"  name="goods_name" size="30" value="<?php if(!empty( $productInfo)){echo $productInfo['PName'];} ?>">
              <div style="float: left; margin-left: 2px" id=font_color 
    onclick=colorselecter.show(this);></div>
              <span 
    class=require-field>*</span></td>
          </tr>
		  <script type="text/javascript">
			 $(function(){
			    var i = $()
			 	if( isset( $productInfo)){
					if( $productInfo['PId'] == )
				}
			 
			 
			 })
			</script>
          <tr>
            <td class=label>商品大类：</td>
            <td><select name="bcat_id" style="width:120px;" id="btype">
			
                <option selected 
    value=0>请选择...</option>
	<?php
	if(isset( $bcat)){
		foreach( $bcat as $key=> $value){
		?>
		 <option 
    value="<?php echo $value['TId']; ?>" <?php if(isset( $productInfo )){if($value['TId']==$productInfo['BCat'] ){?> selected="selected"<?php }}  ?> ><?php echo $value['TName'];?></option>
		<?php 
		}
	
	
	}

	 ?>
     </select>
              <span 
    class=require-field>*</span> </td>
          </tr>
		  <!-- 根据产品的大类查询产品小类  -->
		  <script type="text/javascript">
		  	$(function(){
				$('#btype').change(function(){
					var TId	= $(this).val();
					
					$.ajax({
					url : 'admin.php?con=Products&act=getSCat',
					type: 'GET',
					data: '&TId='+TId,
					error: function(data){
						alert('error');
					},
					success: function(data){
					     //alert(data);
						$('#stype').html(data);

					}
});
				
				});
			});
		  
		  </script>
          <tr>
            <td class=label>商小分类：</td>
            <td><select name="scat_id" style="width:120px;" id="stype" >   
	<?php
	 if( isset( $productSCat )){
	?>
	<option value="<?php echo $productSCat['TId']; ?>" selected="selected"><?php echo $productSCat['TName']; ?></option>
	<?php 	
	
	} ?>
				
              </select>
            </td>
          </tr>
          <script type="text/javascript">
		  	$(function(){
				$('#stype').change(function(){
					var TId	= $(this).val();	
					$.ajax({
					url : 'admin.php?con=Products&act=getBrand',
					type: 'GET',
					data: '&TId='+TId,
					error: function(data){
						alert('error');
					},
					success: function(data){
					//alert(data);
						$('#brand').html(data);

					}
});
				
				});
			});
		  
		  </script>
          <tr>
            <td class=label>商品品牌：</td>
            <td><select  id="brand" name="brand_id" style="width:120px;">
			<?php 
			if( isset($productBrand)){
			?>
			 <option 
    value="<?php echo $productBrand['BId']; ?>" selected="selected"><?php  echo $productBrand['BName'];?></option>
			
			<?php
			}
			?>
               
              </select>
            </td>
          </tr>
          <tr>
            <td class=label>售价：</td>
            <td><input type="text" name="shop_price" value=<?php if( isset( $productInfo)){ echo $productInfo['Price'];} ?>>
              <span 
    class=require-field>*</span></td>
          </tr>
		  
		  <tr>
            <td class=label>消费层次：</td>
            <td>
			<?php 
			if(isset($levels)){
				foreach( $levels  as $key=>$value){
				?>
				<input type="checkbox" name="level[]" class="levels"  style=" margin-right:10px;" value="<?php echo $value['DId']; ?>"/><?php echo  $value['DValue']; ?>
				<?php 
				}
			}
			
			 ?>
						
			
              <span 
    class=require-field>*</span></td>
          </tr>
		  <script type="text/javascript">
		  	$(function(){
				 var str="";
				 var level = $("input[name='level[]']");
				 for(i=0;i<level.length;i++){
				  if(level[i].checked){
				   str += level[i].value;
				  }
				 }
			});
		  
		  </script>
		  <tr>
            <td class=label>适用年龄段：</td>
            <td>
			<?php 
			if(isset($age)){
				foreach( $age  as $key=>$value){
				?>
				<input type="checkbox"  style=" margin-right:10px;"name="age[]" value="<?php echo $value['DId']; ?>"/><?php echo  $value['DValue']; ?>
				<?php 
				}
			}
			
			 ?>
			
			
              <span 
    class=require-field>*</span></td>
          </tr>
		  
		  <tr>
            <td class=label>适用性别：</td>
            <td>
			<?php 
			if(isset($sex)){
				foreach( $sex  as $key=>$value){
				?>
				<input type="checkbox"  style=" margin-right:10px;"name="sex[]" value="<?php echo $value['DId']; ?>"/><?php echo  $value['DValue']; ?>
				<?php 
				}
			}
			
			 ?>
              <span 
    class=require-field>*</span></td>
          </tr>
		  <?php
		  if( isset( $productInfo )){
		  ?>
		   <tr>
		  	<td class=label>商品图片：</td>
			<td><img src="file/uploads/goods_img/<?php echo $productInfo['PicGoods']; ?>"></td>
		  </tr>
		  <input type="hidden" name="PicGoods" value="<?php echo $productInfo['PicGoods'];  ?>" />
		  <input type="hidden" name="PicOriginal" value="<?php echo $productInfo['PicOriginal']; ?>" />
		  <?php 
		  }
		   ?>
		  
          <tr>
            <td class=label>上传商品图片</td>
            <td><input name="goods_img" size="35" type="file">
              <img 
    src="file/img/no.gif"> <br>
             
            </td>
          </tr>
		 
          <tr id="auto_thumb_1">
            <td class="label">上传商品缩略图：</td>
            <td id="auto_thumb_3"><input name=goods_thumb size=35 type=file>
              <img 
    src="file/img/no.gif"> <br>
            
            </td>
          </tr>
		  <tr>
		  	<td class="label">是否进行推送</td>
			<td><input type="checkbox" name="push" value="1"></td>
		  </tr>
        </tbody>
      </table>
    

      <div class=button-div>
	  	<input type="hidden" name="pid" value="<?php if( isset( $productInfo)){ echo $productInfo['PId'];} ?>"/>
        <input class=button  value=" 确定 " type="submit">
        <input class=button value=" 重置 " type="reset">
      </div>
     
    </form>
  </div>
</div>

<div id=footer>共执行 9 个查询，用时 0.012779 秒，gzip 已禁用，内存占用 3.258 mb<br>
  版权所有 © 
  2005-2012 上海商派网络科技有限公司，并保留所有权利。</div>
</body>
</html>
